/* Includes ------------------------------------------------------------------*/
#include "MyApplication.h"

/* Private define-------------------------------------------------------------*/

/* Private variables----------------------------------------------------------*/
static uint8_t pucSend_Buffer[PUCUART2_SEND_BUFFER_LEN] = {0x00};
static uint8_t pucRec_Buffer[PUCUART2_REC_BUFFER_LEN] = {0x00};

static void SendArray(uint8_t* ,uint16_t );
static void SendString(uint8_t* );
static void RS485_Set_SendMode(void);
static void RS485_Set_RecMode(void);
/* Public variables-----------------------------------------------------------*/
UART_t UART2 = 
{
    pucSend_Buffer,
    pucRec_Buffer,

    SendArray,
    SendString,
    TTL,
    RS485_Set_SendMode,
    RS485_Set_RecMode
};
/* Private function prototypes------------------------------------------------*/

/*
* @name   SendArray
* @brief  发送数组
* @param  p_Arr：数据首地址，LEN：数组长度
* @retval None   
*/
static void SendArray(uint8_t* p_Arr,uint16_t LEN)
{
    HAL_UART_Transmit_DMA(&huart2,p_Arr,LEN);
}

/*
* @name   SendString
* @brief  发送字符串
* @param  p_Str：字符串首地址
* @retval None   
*/
static void SendString(uint8_t* p_Str)
{
    HAL_UART_Transmit_DMA(&huart2,p_Str,strlen((const char*)p_Str));
}

/*
* @name   RS485_Set_SendMode
* @brief  RS_485设置为发送模式
* @param  None
* @retval None   
*/
static void RS485_Set_SendMode(void)
{

}


/*
* @name   RS485_Set_RecMode
* @brief  RS_485设置为接收模式
* @param  None
* @retval None   
*/
static void RS485_Set_RecMode(void)
{

}
/********************************************************
  End Of File
********************************************************/
